package com.wx.gof.pattern.behavioral.visitor;

/**
 * @ClassName Visitor
 * @Author wx
 * @Description 访问者实现
 * @Date 2018-12-16-18:27
 */
public class Visitor implements IVisitor{
    @Override
    public void visit(FreeCourse freeCourse) {
        System.out.println("这是免费课程:" + freeCourse.name);
    }

    @Override
    public void visit(ChargeCourse chargeCourse) {
        System.out.println("这是收费课程:" + chargeCourse.getPrice() + "-价格:" + chargeCourse.getPrice());
    }
}
